

<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>Client &mdash; vt-py  documentation</title>
  

  
  
  
  

  
  <script type="text/javascript" src="../_static/js/modernizr.min.js"></script>
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
        <script type="text/javascript" src="../_static/jquery.js"></script>
        <script type="text/javascript" src="../_static/underscore.js"></script>
        <script type="text/javascript" src="../_static/doctools.js"></script>
        <script type="text/javascript" src="../_static/language_data.js"></script>
    
    <script type="text/javascript" src="../_static/js/theme.js"></script>

    

  
  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="Feed" href="feed.html" />
    <link rel="prev" title="API reference" href="../apireference.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../index.html" class="icon icon-home"> vt-py
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../howtoinstall.html">How to install</a></li>
<li class="toctree-l1"><a class="reference internal" href="../overview.html">Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart.html">Quickstart</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../apireference.html">API reference</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">Client</a></li>
<li class="toctree-l2"><a class="reference internal" href="feed.html">Feed</a></li>
<li class="toctree-l2"><a class="reference internal" href="object.html">Object</a></li>
<li class="toctree-l2"><a class="reference internal" href="iterator.html">Iterator</a></li>
<li class="toctree-l2"><a class="reference internal" href="utils.html">Utilities</a></li>
</ul>
</li>
</ul>

            
          
        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../index.html">vt-py</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../index.html">Docs</a> &raquo;</li>
        
          <li><a href="../apireference.html">API reference</a> &raquo;</li>
        
      <li>Client</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
            
            <a href="../_sources/api/client.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="module-vt">
<span id="client"></span><h1>Client<a class="headerlink" href="#module-vt" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="vt.Client">
<em class="property">class </em><code class="sig-prename descclassname">vt.</code><code class="sig-name descname">Client</code><span class="sig-paren">(</span><em class="sig-param">apikey</em>, <em class="sig-param">agent='unknown'</em>, <em class="sig-param">host=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client" title="Permalink to this definition">¶</a></dt>
<dd><p>Client for interacting with VirusTotal.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>apikey</strong> (<em>str</em>) – Your VirusTotal API key.</p></li>
<li><p><strong>agent</strong> (<em>str</em>) – A string that identifies your application.</p></li>
<li><p><strong>host</strong> (<em>str</em>) – By default <a class="reference external" href="https://www.virustotal.com">https://www.virustotal.com</a>, it can be changed for
testing purposes.</p></li>
</ul>
</dd>
</dl>
<dl class="method">
<dt id="vt.Client.close">
<code class="sig-name descname">close</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.close"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.close" title="Permalink to this definition">¶</a></dt>
<dd><p>Closes the client.</p>
<p>When the client is not needed anymore it should be closed for releasing
resources like TCP connections.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.close_async">
<em class="property">async </em><code class="sig-name descname">close_async</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.close_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.close_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.close" title="vt.Client.close"><code class="xref py py-func docutils literal notranslate"><span class="pre">close()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.delete">
<code class="sig-name descname">delete</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.delete"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.delete" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a DELETE request to a given API endpoint.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.delete_async">
<em class="property">async </em><code class="sig-name descname">delete_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.delete_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.delete_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.delete" title="vt.Client.delete"><code class="xref py py-func docutils literal notranslate"><span class="pre">delete()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.download_file">
<code class="sig-name descname">download_file</code><span class="sig-paren">(</span><em class="sig-param">hash</em>, <em class="sig-param">file</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.download_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.download_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Downloads a file given its hash (SHA-256, SHA-1 or MD5).</p>
<p>The file identified by the hash will be written to the provided file
object. The file object must be opened in write binary mode (‘wb’).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>hash</strong> (<em>str</em>) – File hash.</p></li>
<li><p><strong>file</strong> (<em>file-like object</em>) – A file object where the downloaded file will be written to.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.download_file_async">
<em class="property">async </em><code class="sig-name descname">download_file_async</code><span class="sig-paren">(</span><em class="sig-param">hash</em>, <em class="sig-param">file</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.download_file_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.download_file_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.download_file" title="vt.Client.download_file"><code class="xref py py-func docutils literal notranslate"><span class="pre">download_file()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.feed">
<code class="sig-name descname">feed</code><span class="sig-paren">(</span><em class="sig-param">feed_type</em>, <em class="sig-param">cursor=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.feed"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.feed" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterator for a VirusTotal feed.</p>
<p>This functions returns an iterator that allows to retrieve a continuous
stream of files as they are scanned by VirusTotal. See the documentation
for the <code class="xref py py-class docutils literal notranslate"><span class="pre">Feed</span></code> class for more details.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>feed_type</strong> – One of the supported feed types enumerated in
<code class="xref py py-class docutils literal notranslate"><span class="pre">FeedType</span></code>.</p></li>
<li><p><strong>cursor</strong> (<em>str</em>) – An optional cursor indicating where to start. This argument
can be a string in the format ‘YYYMMDDhhmm’ indicating the date and time
of the first package that will be retrieved.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get">
<code class="sig-name descname">get</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request to a given API endpoint.</p>
<p>This is a low-level function that returns a raw HTTP response, no error
checking nor response parsing is performed. See <a class="reference internal" href="#vt.Client.get_json" title="vt.Client.get_json"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_json()</span></code></a>,
<a class="reference internal" href="#vt.Client.get_data" title="vt.Client.get_data"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_data()</span></code></a> and <a class="reference internal" href="#vt.Client.get_object" title="vt.Client.get_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_object()</span></code></a> for higher-level functions.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>params</strong> (<em>dict</em>) – Parameters sent in the request.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_async">
<em class="property">async </em><code class="sig-name descname">get_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.get" title="vt.Client.get"><code class="xref py py-func docutils literal notranslate"><span class="pre">get()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_data">
<code class="sig-name descname">get_data</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_data"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_data" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request to a given API endpoint and returns response’s data.</p>
<p>Most VirusTotal API responses are JSON-encoded with the following format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span><span class="s2">&quot;data&quot;</span><span class="p">:</span> <span class="o">&lt;</span><span class="n">response</span> <span class="n">data</span><span class="o">&gt;</span><span class="p">}</span>
</pre></div>
</div>
<p>This function parses the server’s response and return only the data, if the
response is not in the expected format an exception is raised. For endpoints
where the data is a VirusTotal object you can use <a class="reference internal" href="#vt.Client.get_object" title="vt.Client.get_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_object()</span></code></a> instead.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>params</strong> (<em>dict</em>) – Parameters sent in the request.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>Whatever the server returned in the response’s data field, it may be a
dict, list, string or some other Python type, depending on the endpoint
called.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_data_async">
<em class="property">async </em><code class="sig-name descname">get_data_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_data_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_data_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.get_data" title="vt.Client.get_data"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_data()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_error_async">
<em class="property">async </em><code class="sig-name descname">get_error_async</code><span class="sig-paren">(</span><em class="sig-param">response</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_error_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_error_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Given a <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a> returns a <a class="reference internal" href="#vt.APIError" title="vt.APIError"><code class="xref py py-class docutils literal notranslate"><span class="pre">APIError</span></code></a></p>
<p>This function checks if the response from the VirusTotal backend was an
error and returns the appropriate <a class="reference internal" href="#vt.APIError" title="vt.APIError"><code class="xref py py-class docutils literal notranslate"><span class="pre">APIError</span></code></a> or None if no error
occurred.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>response</strong> – A <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a> instance.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <a class="reference internal" href="#vt.APIError" title="vt.APIError"><code class="xref py py-class docutils literal notranslate"><span class="pre">APIError</span></code></a> or None.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_json">
<code class="sig-name descname">get_json</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_json"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_json" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request to a given API endpoint and parses the response.</p>
<p>Most VirusTotal API responses are JSON-encoded. This function parses the
JSON, check for errors, and return the server response as a dictionary.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>params</strong> (<em>dict</em>) – Parameters sent in the request.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>A dictionary with the backend’s response.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_json_async">
<em class="property">async </em><code class="sig-name descname">get_json_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_json_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_json_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.get_json" title="vt.Client.get_json"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_json()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_object">
<code class="sig-name descname">get_object</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_object" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a GET request to a given API endpoint and returns an object.</p>
<p>The endpoint specified must return an object, not a collection. This
means that get_object can be used with endpoints like /files/{file_id}
and /urls/{url_id}, which return an individual object but not with
/comments, which returns a collection of objects.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>params</strong> (<em>dict</em>) – Parameters sent in the request.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.get_object_async">
<em class="property">async </em><code class="sig-name descname">get_object_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.get_object_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.get_object_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.get_object" title="vt.Client.get_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">get_object()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.iterator">
<code class="sig-name descname">iterator</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">params=None</em>, <em class="sig-param">cursor=None</em>, <em class="sig-param">limit=0</em>, <em class="sig-param">batch_size=0</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.iterator"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.iterator" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns an iterator for the collection specified by the given path.</p>
<p>The endpoint specified by path must return a collection of objects. An
example of such an endpoint are /comments and /intelligence/search.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint returning a collection.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>params</strong> (<em>dict</em>) – Additional parameters passed to the endpoint.</p></li>
<li><p><strong>cursor</strong> (<em>str</em>) – Cursor for resuming the iteration at the point it was left
previously. A cursor can be obtained with Iterator.cursor(). This
cursor is not the same one returned by the VirusTotal API.</p></li>
<li><p><strong>limit</strong> (<em>int</em>) – Maximum number of objects that will be returned by the iterator.
If a limit is not provided the iterator continues until it reaches the
last object in the collection.</p></li>
<li><p><strong>batch_size</strong> (<em>int</em>) – Maximum number of objects retrieved on each call to the
endpoint. If not provided the server will decide how many objects to
return.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Iterator</span></code>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.patch">
<code class="sig-name descname">patch</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">data=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.patch"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.patch" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PATCH request to a given API endpoint.</p>
<p>This is a low-level function that returns a raw HTTP response, no error
checking nor response parsing is performed. See <a class="reference internal" href="#vt.Client.patch_object" title="vt.Client.patch_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">patch_object()</span></code></a> for
a higher-level function.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>data</strong> (<em>A string</em><em> or </em><em>bytes</em>) – Data sent in the request body.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.patch_async">
<em class="property">async </em><code class="sig-name descname">patch_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">data=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.patch_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.patch_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.patch" title="vt.Client.patch"><code class="xref py py-func docutils literal notranslate"><span class="pre">patch()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.patch_object">
<code class="sig-name descname">patch_object</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.patch_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.patch_object" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a PATCH request for modifying an object.</p>
<p>This function modifies an object. The endpoint must be one that identifies
an object, like /intelligence/hunting_rulesets/{id}.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>obj</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code>) – Object that has been modified.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code> representing the same object after
the changes has been applied.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.patch_object_async">
<em class="property">async </em><code class="sig-name descname">patch_object_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.patch_object_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.patch_object_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.patch_object" title="vt.Client.patch_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">patch_object()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.post">
<code class="sig-name descname">post</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">data=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.post"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.post" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a POST request to a given API endpoint.</p>
<p>This is a low-level function that returns a raw HTTP response, no error
checking nor response parsing is performed. See <a class="reference internal" href="#vt.Client.post_object" title="vt.Client.post_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">post_object()</span></code></a> for
a higher-level function.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint, can contain format placeholders {}.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>data</strong> (<em>A string</em><em> or </em><em>bytes</em>) – Data sent in the request body.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <a class="reference internal" href="#vt.ClientResponse" title="vt.ClientResponse"><code class="xref py py-class docutils literal notranslate"><span class="pre">ClientResponse</span></code></a>.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.post_async">
<em class="property">async </em><code class="sig-name descname">post_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">data=None</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.post_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.post_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.post" title="vt.Client.post"><code class="xref py py-func docutils literal notranslate"><span class="pre">post()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.post_object">
<code class="sig-name descname">post_object</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.post_object"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.post_object" title="Permalink to this definition">¶</a></dt>
<dd><p>Sends a POST request for creating an object.</p>
<p>This function create a new object. The endpoint must be one that identifies
a collection, like /intelligence/hunting_rulesets.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>path</strong> (<em>str</em>) – Path to API endpoint.</p></li>
<li><p><strong>path_args</strong> – A variable number of arguments that are put into any
placeholders used in path.</p></li>
<li><p><strong>obj</strong> (<code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code>) – Instance <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code> with the type expected by the API
endpoint.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code> representing the new object.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.post_object_async">
<em class="property">async </em><code class="sig-name descname">post_object_async</code><span class="sig-paren">(</span><em class="sig-param">path</em>, <em class="sig-param">*path_args</em>, <em class="sig-param">obj</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.post_object_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.post_object_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.post_object" title="vt.Client.post_object"><code class="xref py py-func docutils literal notranslate"><span class="pre">post_object()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.scan_file">
<code class="sig-name descname">scan_file</code><span class="sig-paren">(</span><em class="sig-param">file</em>, <em class="sig-param">wait_for_completion=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.scan_file"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.scan_file" title="Permalink to this definition">¶</a></dt>
<dd><p>Scans a file.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>file</strong> (<em>File-like object.</em>) – File to be scanned.</p></li>
<li><p><strong>wait_for_completion</strong> (<em>bool</em>) – If True the function doesn’t return until the
analysis has been completed.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code> of analysis type.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.scan_file_async">
<em class="property">async </em><code class="sig-name descname">scan_file_async</code><span class="sig-paren">(</span><em class="sig-param">file</em>, <em class="sig-param">wait_for_completion=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.scan_file_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.scan_file_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.scan_file" title="vt.Client.scan_file"><code class="xref py py-func docutils literal notranslate"><span class="pre">scan_file()</span></code></a> but returns a coroutine.</p>
</dd></dl>

<dl class="method">
<dt id="vt.Client.scan_url">
<code class="sig-name descname">scan_url</code><span class="sig-paren">(</span><em class="sig-param">url</em>, <em class="sig-param">wait_for_completion=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.scan_url"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.scan_url" title="Permalink to this definition">¶</a></dt>
<dd><p>Scans a URL.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>url</strong> (<em>str</em>) – The URL to be scanned.</p></li>
<li><p><strong>wait_for_completion</strong> (<em>bool</em>) – If True the function doesn’t return until the
analysis has been completed.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>An instance of <code class="xref py py-class docutils literal notranslate"><span class="pre">Object</span></code> of analysis type.</p>
</dd>
</dl>
</dd></dl>

<dl class="method">
<dt id="vt.Client.scan_url_async">
<em class="property">async </em><code class="sig-name descname">scan_url_async</code><span class="sig-paren">(</span><em class="sig-param">url</em>, <em class="sig-param">wait_for_completion=False</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#Client.scan_url_async"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.Client.scan_url_async" title="Permalink to this definition">¶</a></dt>
<dd><p>Like <a class="reference internal" href="#vt.Client.scan_url" title="vt.Client.scan_url"><code class="xref py py-func docutils literal notranslate"><span class="pre">scan_url()</span></code></a> but returns a coroutine.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="vt.ClientResponse">
<em class="property">class </em><code class="sig-prename descclassname">vt.</code><code class="sig-name descname">ClientResponse</code><span class="sig-paren">(</span><em class="sig-param">aiohttp_resp</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/client.html#ClientResponse"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.ClientResponse" title="Permalink to this definition">¶</a></dt>
<dd><p>Class representing the HTTP responses returned by the client.</p>
<p>This class is just a thing wrapper around <a class="reference external" href="https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse">aiohttp.ClientResponse</a>
that allows using it in both asynchronous and synchronous mode. Instances of
this class have all the attributes that you can find in <cite>aiohttp.ClientResponse</cite>,
like <cite>version</cite>, <cite>status</cite>, <cite>method</cite>, <cite>url</cite>, and so on. Methods in
<cite>aiohttp.ClientResponse</cite> that return a coroutine have two flavors in this
class: synchronous and asynchronous. For example, <cite>aiohttp.ClientResponse.read()</cite>
becomes <cite>vt.ClientResponse.read_async()</cite>, and <cite>vt.ClientResponse.read()</cite> is
the synchronous version of <cite>vt.ClientResponse.read_async()</cite>. Find more
information about attributes and methods in <cite>aiohttp.ClientResponse</cite> in:</p>
<p><a class="reference external" href="https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse">https://aiohttp.readthedocs.io/en/stable/client_reference.html#aiohttp.ClientResponse</a></p>
</dd></dl>

<dl class="exception">
<dt id="vt.APIError">
<em class="property">exception </em><code class="sig-prename descclassname">vt.</code><code class="sig-name descname">APIError</code><span class="sig-paren">(</span><em class="sig-param">code</em>, <em class="sig-param">message</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/vt/error.html#APIError"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#vt.APIError" title="Permalink to this definition">¶</a></dt>
<dd><p>Class that encapsules errors returned by the VirusTotal API.</p>
</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="feed.html" class="btn btn-neutral float-right" title="Feed" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
      
      
        <a href="../apireference.html" class="btn btn-neutral float-left" title="API reference" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
      
    </div>
  

  <hr/>

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, VirusTotal

    </p>
  </div>
  Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>

        </div>
      </div>

    </section>

  </div>
  


  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>